package com.project.mall.service;

import com.project.mall.mapper.MapperW;
import com.project.mall.pojo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ServiceImplW implements ServiceW {
    @Resource
    private MapperW mapper;
    //根据id查询参数信息
    public List<Goods> getGoodsInfoByGid(@Param("gid") Integer gid){
        return mapper.getGoodsInfoByGid(gid);
    }
    //查询信息
    public Goods getGoods(@Param("gid") Integer gid){
        return mapper.getGoods(gid);
    }
    //查询家电参数信息
    public Applianceparam getAppliParm(@Param("gid")Integer gid){
      return  mapper.getAppliParm(gid);
    }
    //查询其他参数信息
    public Goods getGoodsParm(@Param("gid")Integer gid){
        return mapper.getGoodsParm(gid);
    }
    //通过商品id查询概述图片文件夹路径
    public String getImgSource(Integer gid){
        return mapper.getImgSource(gid);
    }
    //通过商品id加载其所有评论
    public List<Comment> getComment(Integer gid){
        return  mapper.getComment(gid);
    }
    //通过颜色id获取颜色
    public Goodscolor getcolorbygcolorid(Integer gcolorid){
        return mapper.getcolorbygcolorid(gcolorid);
    }
    //通过类型id获取类型
    public Goodstype gettypebygtypeid(Integer gtypeid){
        return mapper.gettypebygtypeid(gtypeid);
    }


    @Override
    public List<Showimages> getPicList(int gid) {
        return mapper.getPicList(gid);
    }

    @Override
    public List<Infoimages> getInfoList(int gid) {
        return mapper.getInfoList(gid);
    }

}
